package sim1011.poltergeist;

import java.util.ArrayList;
import java.util.HashMap;

import sim1011.starter.EctoMobileStarter;

public class DummyArbiter extends Arbiter {
	
	private HashMap<String, Float> finalRank;
	
	public DummyArbiter(HashMap<String, Float> rank) {		
		this.finalRank = rank;
	}

	
	@Override
	public void makeYourDecision(String component, String curContainer,
			ArrayList<String> availableNodes, HashMap<String, Float> finalRank) {
		this.finalRank = finalRank;
		 for(String nodeName : availableNodes){
			 if(nodeName.equals(curContainer)){
				 finalRank.put(curContainer, EctoMobileStarter.MAX_RANK_VAL-15);
			 }
			 else{				 
				 finalRank.put(nodeName, (float)EctoMobileStarter.r.nextInt((int)EctoMobileStarter.MAX_RANK_VAL));
			 }
		 }	
	}

}
